<template>
  <component :is="currentComponent" :item="item"></component>
</template>

<script>
import NavSingle from './nav-single'
import NavMore from './nav-more'
export default {
  components:{
    NavSingle,
    NavMore
  },
  data(){
    return {
      currentComponent:NavSingle
    }
  },
  created(){
     if(this.item.hasOwnProperty('children')){
       this.currentComponent = NavMore
     }else{
       this.currentComponent = NavSingle;
     }
  },
  props: ["item"]
};
</script>

<style>
</style>